package Controller.Singer;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.SboardBean;
import Dao.SingerDao;

public class singerBoardDetailController implements Controller{
	private SingerDao dao;
	
	public void setDao(SingerDao dao) {
		this.dao = dao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {

		Integer sb_no = Integer.parseInt(req.getParameter("sb_no"));
		System.out.println(sb_no);
		
		List<SboardBean> bean = dao.sboardDetail(sb_no);
		System.out.println("가수게시판 디테일 성공!!");
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("sboardDetail");
		mav.addObject("detail", bean);
		mav.addObject("sb_no", sb_no);
		return mav;
	}

}
